function [zm,sd]=stdest(z)

[N,k]=size(z);
if k==0
    zm=NaN;
    sd=NaN;
else
    zm=ones(1,N)*z/N;
    ap=z-ones(N,1)*zm;

    vg=ap'*ap/N;
    sd=zeros(k,1);
    for i=1:k
        sd(i,1)=1/(N^0.5)*(vg(i,i)^0.5);
    end
    zm=zm';
    sd=sd';
end